using System.ComponentModel.DataAnnotations;

namespace MonitorPlatform.Data.Entities
{
    public class UserBehavior : BaseEntity
    {
        [Required]
        [StringLength(50)]
        public string AppId { get; set; } = string.Empty;

        [Required]
        [StringLength(100)]
        public string SessionId { get; set; } = string.Empty;

        [StringLength(100)]
        public string? UserId { get; set; }

        public DateTime Timestamp { get; set; }

        [Required]
        [StringLength(50)]
        public string EventType { get; set; } = string.Empty;

        [StringLength(200)]
        public string? EventName { get; set; }

        // Element Information
        [StringLength(500)]
        public string? TargetElement { get; set; }

        [StringLength(200)]
        public string? TargetClass { get; set; }

        [StringLength(200)]
        public string? TargetId { get; set; }

        [StringLength(200)]
        public string? TargetText { get; set; }

        [StringLength(200)]
        public string? TargetValue { get; set; }

        // Page Information
        [StringLength(500)]
        public string? PageUrl { get; set; }

        [StringLength(500)]
        public string? PageTitle { get; set; }

        [StringLength(500)]
        public string? Referrer { get; set; }

        // Mouse/Touch Position
        public int? MouseX { get; set; }
        public int? MouseY { get; set; }

        // Scroll Information
        public int? ScrollX { get; set; }
        public int? ScrollY { get; set; }
        public int? ScrollDepth { get; set; }

        // Viewport Information
        public int? ViewportWidth { get; set; }
        public int? ViewportHeight { get; set; }

        // Form Information (for form events)
        public string? FormId { get; set; }
        public string? FormName { get; set; }
        public string? FieldName { get; set; }
        public string? FieldType { get; set; }

        // Custom Event Data
        public string? CustomData { get; set; }

        // Event Context
        public string? EventContext { get; set; }
        public int? Duration { get; set; }

        // Additional Information
        public string? UserAgent { get; set; }
        public string? IpAddress { get; set; }

        // Navigation properties
        public virtual Application Application { get; set; } = null!;
    }
} 